﻿@using QDT.Core.Members
@model QDT.Common.IPagedList<QDT.Core.OfflineInvest.OfflineContract>
@{
    Func<int, string> Status = x =>
    {
        switch (x)
        {
            case -2:
                return "申请驳回";
            case -1:
                return "待审核";
            case 0:
                return "审核通过";
            case 1:
                return "提现待审核";
            case 2:
                return "待转让";
            case 3:
                return "转让中";
            case 4:
                return "结束";
            default:
                return "";
        }
    };
}

@section HeadSection {
    <script type="text/javascript">

        function show_detail(contractId) {
            var url = '@Url.Action("ShowDetail")' + '?id=' + contractId;
            showAjaxResult(url, "借款详细统计", 700, 400);
        }

    </script>
}

<div class="main_title">
    线下投资记录</div>
<div class="blank5">
</div>
    <div class="search_row">
	    <form name="search" action="@Url.Action("InvestCarry")" method="get">	
            会员ID：<input type="text" class="textbox" name="userid"  size="8" value="@Request.Params["userid"]"/>
            会员名称：<input type="text" class="textbox" size="8" name="username" value="@Request.Params["username"]"/>
		    真名:<input type="text" class="textbox" size="8" name="realname" value="@Request.Params["realname"]" />
	        <input type="submit" class="button" value="搜索"/>
	    </form>
    </div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column => {
                                  column.CheckBox(x => x.ID);
                                  column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;align:center;");
                                  column.For(x => x.UserId).Named("会员编号").SortColumnName("UserId");
                                  column.For(x => x.UserName).Named("会员名称");
                                  column.For(x => x.StartDate.ToShortDateString()).Named("合同开始日期").SortColumnName("StartDate");
                                  column.For(x => x.EndDate.ToShortDateString()).Named("合同结束日期").SortColumnName("EndDate");
                                  column.For(x => x.InvestEndDate.ToShortDateString()).Named("投资结束时期").SortColumnName("InvestEndDate");
                                  column.For(x => x.Money).Named("合同金额").Format("{0:C2}");
                                  column.For(x => x.OverMoney).Named("投资余额").Format("{0:C2}");
                                  column.For(x => x.RepayEarning).Named("已得利息").Format("{0:C2}");
                                  column.For(x => Status(x.Status)).Named("状态");
                                  column.For(x => Html.F().GetUserGroupByUserId(x.UserId)).Named("会员组");
                                  column.Buttons(btns => btns.Add(x => Html.ScriptLink("投标列表", "show_detail({0})", x.ID))
                                                                        .Add(x => Html.ActionLink(x.Status.Equals(1) ? "同意" : " ", "ProcessContract", new { id = x.ID, isAgree = true }))
                                                                        .Add(x => Html.ActionLink(x.Status.Equals(1) ? "拒绝" : " ", "ProcessContract", new { id = x.ID, isAgree = false }))
                                                                        .Add(x => Html.ActionLink(x.Status.Equals(2) ? "转让" : " ", "SubmitAssign", new { id = x.ID })));
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)
